package com.mtask.common.entity.task;

import com.mtask.common.entity.base.BaseEntity;
import lombok.*;
import org.hibernate.annotations.BatchSize;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "task_project")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class TaskProject extends BaseEntity {
    private String name;
    private String remark;
    private Boolean isRecEmail;
    private String recEmails;
    private String sign;
    private String signString;


    @OneToMany(mappedBy = "taskProject", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @OrderBy("id ASC")
    @BatchSize(size = 20)
    private Set<TaskGroup> taskGroups = new HashSet<>();

}
